<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>内容页</title>
		<link rel="stylesheet" type="text/css" href="http://127.0.0.1/huaweishop/Static/Index/css/index.css"/>
		<link rel="stylesheet" type="text/css" href="http://127.0.0.1/huaweishop/Static/Index/css/list.css"/>
		<link rel="stylesheet" type="text/css" href="http://127.0.0.1/huaweishop/Static/Index/css/content.css"/>
		<script src="http://127.0.0.1/huaweishop/Static/Index/js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>		
		<script src="http://127.0.0.1/huaweishop/Static/Index/js/contab.js" type="text/javascript" charset="utf-8"></script>
		<script src="http://127.0.0.1/huaweishop/Static/Index/js/num.js" type="text/javascript" charset="utf-8"></script>
	
		
		<script type="text/javascript">
			var url="<?php echo U('Cart/cart');?>";
			var shop = {
				//货品id     商品名字     购买的数量    价格 
				"glid" :false,
				"gname":'<?php echo $goods['gname'];?>',
				"num":false,
				"price":false,
				"combin":false,
				"gid":false
				
			}
		</script>
		
		
		<script type="text/javascript">
				$(function(){
					$(".standard").click(function(){						
                        $(this).css({border:"1px solid red"}).siblings(".standard").css({border:"1px solid #B2B2B2"});
                        $(this).addClass("d").siblings(".standard").removeClass("d");                     
                        var len=$(".len").length;
                        var d=$(".d").length;
                        if(len!=d){
                       	return false;
                       	}
                        
                       
                        shop.price=parseInt($(".price").html());

                       	var gtids="";
	                    $.each($(".d"), function() {
	                 
	                       	gtids +=$(this).attr("gtid")+',';
	                       	
	                       });
	                       
	                    //发异步
                        var gtid=gtids;
                        var gid = $(this).attr('gid');
	                       
	                       $.ajax({	                       
		                       	type:"post",
		                       	url:"<?php echo U('ajaxmsg');?>",
		                       	data:{gid:gid,gtid:gtid},
		                       	dataType:'json',
		                       	success:function(data){
		                       		
		                       		var str='<tr><td>华 为  价：</td> <td>￥<span  class="price"  style="font-size: 20px; color:#E01D20 ;">'+data.price+'</span></td> </tr>'+'<tr><td>商品编码：</td> <td>'+data.number+'</td> </tr>'+'<tr><td>商品评分：</td><td><s class="s"></s>（共 183 条评论）</td> </tr>'+'<tr><td>运      费：</td> <td>满 100 免运费</td> </tr>'+'<tr><td>服      务：</td><td>由华为商城负责发货，并提供售后服务</td></tr>	';
		                       		var st='（库存'+data.inventory+'件）';
		                       		 $('#price').html(str);
		                       		  $('.inventory').html(st);
		                       		  
		                       		  shop.glid=data.glid;
		                       		  shop.combin=data.combin;
		                       		  shop.gid=data.goods_gid;
		                       		  inventory=data.inventory;
		                       	}		                       	
	                       });
                      
					})
					

					           
								$(".shop_btn").click(function(){
							   	//货品id     商品名字     购买的数量    价格
							   	shop.num=$(".num input").val();
						   	 		if(shop.glid && shop.gname && shop.num && shop.price && shop.combin && shop.gid){
						   	 			
						   	 			 alert("成功加入购物车");
							   	 				
							   	 			 $.ajax({
											   	  	type:"post",
											   	  	url:url,
											   	  	data:shop,
											   	  	dataType:'json',
											   	  	success:function(phpdata){
											   	  		var tt='    <?php if(!'+phpdata+'){ ?><p style="line-height: 110px;">您的购物车是空的赶紧选购吧</p><?php }else{ ?>'+'<div class="thing"><table class="cart-thing"  width="100%" cellspacing="0" cellpadding="0" style="margin: 0 auto; "><div class="payall"><h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;共<s>'+phpdata.total_rows+'</s>件商品，金额合计<s>￥'+phpdata.total+'</s></h2><div class="money"><a style="color:#FFFFFF" href="<?php echo U('Cart/index');?>">去结算</a></div></div></div><?php } ?>';
											   	  		
											   	  		var strs="";
													
											   	  		$.each(phpdata.goods, function(k,v) {
											   	  			var url = "http://127.0.0.1/huaweishop/index.php/Index/Cart/del/id/"+k;
											   	  			
											   	  			strs+='<tr ><td style="border-bottom: 1px solid #FAFAFA;"><img width="78" height="78" src="http://127.0.0.1/huaweishop/'+v.pic+'"/>'+'</td>'+'<td style="border-bottom: 1px solid #FAFAFA;" width="60%">'+'<p><a href="">'+v.name+'</a></p><h1>¥ '+v.price+'<i>×'+v.num+'</i>  </h1></td><td style="text-align: center; width: 20%; border-bottom: 1px solid #FAFAFA;"><a href="'+url+'" class="btn_x" >删除</a></td></tr>';
//											   	  			
											   	  		});
											   	  		$(".cart_in").html(tt);	
											   	  		$(".thing .cart-thing").prepend(strs);	
											   	  		
											   	  	}
											 });
							   	 		}
							   })
				})
		</script>

	</head>
	<body>
	   <?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!--顶部导航开始-->
		<div id="topnav">
			<div class="top_left">
				<ul>
					<li><a href="">华为官网</a>|</li>
					<li><a href="">华为荣耀</a>|</li>
					<li><a href="">EMUI</a>|</li>
					<li><a href="">应用市场</a>|</li>
					<li><a href="">云服务</a>|</li>
					<li><a href="">开发者联盟</a>|</li>
					<li><a href="">花粉俱乐部</a></li>
				</ul>
				
			</div>
			<div class="top_right">
				<ul>
					<?php if (empty($hd['session']['uname'])){ ?>
					<li><a href="<?php echo U('Member/login');?>"><span>登陆</span> </a></li>					
					<li><a href="<?php echo U('Member/regist');?>"><span>注册</span></a>|</li>
					<?php }else{ ?>
					<li><a href="<?php echo U('Personal/index');?>"><span><?php echo $hd['session']['uname'];?></span></a>|<a href="<?php echo U('Member/out');?>"><span>退出</span></a></li>
					<?php } ?>
					<li><a href="">v码（优购码）</a>|</li>
					<li><a href="">手机版</a>|</li>
					<li><a href="">网站导航</a></li>
				</ul>
				
			</div>
		</div>
		<!--顶部导航结束-->
		<!--logo开始-->
		<div id="header">
			<div class="logo">
				<a href="<?php echo U('Index/index');?>"><img src="http://127.0.0.1/huaweishop/Static/Index/images/Logo.png"/></a>
			</div>
			<div class="search">
				<form action="" method="post">				
					<input type="text" name="" class="box" /><input class="button" type="submit" value="搜索"/>
				</form>
				<span>热门搜索：
					<a href="">荣耀7</a>
					<a href="">麦芒4</a>
					<a href="">华为p8</a>
					<a href="">指纹识别</a>
					<a href="">指纹识别</a>
					<a href="">指纹识别</a>
				</span>
			</div>
			<div class="shop">
				<div class="mall">
				    <a class="a" href="">我的商城</a>	
				</div><span>|</span>
				<div class="cart">
					<a class="a" href="">我的购物车</a>
					<div class="cart_in">
						    <?php if(!$_SESSION['cart']['goods']){ ?>
						<p style="line-height: 110px;">您的购物车是空的赶紧选购吧</p>
						<?php }else{ ?>
						<div class="thing">
							<table class="cart-thing"  width="100%" cellspacing="0" cellpadding="0" style="margin: 0 auto; ">
								<?php foreach ($_SESSION['cart']['goods'] as $k=>$v){?>
								<tr >
									<td style="border-bottom: 1px solid #FAFAFA;"><img width="78" height="78" src="http://127.0.0.1/huaweishop/<?php echo $v['pic'];?>"/></td>
									<td style="border-bottom: 1px solid #FAFAFA;" width="60%"><p><a href=""><?php echo $v['name'];?></a></p><h1>¥ <?php echo $v['price'];?> <i>×<?php echo $v['num'];?></i>  </h1></td><td style="text-align: center; width: 20%; border-bottom: 1px solid #FAFAFA;"><a href="<?php echo U('Cart/del',array('id'=>$k));?>" class="btn_x" >删除</a></td>
								</tr>
								<?php }?>
							</table>
							<div class="payall">
								<h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;共<s><?php echo $hd['session']['cart']['total_rows'];?></s>件商品，金额合计<s>￥<?php echo $hd['session']['cart']['total'];?></s></h2>
								<div class="money">
									<a style="color: #FFFFFF;" href="<?php echo U('Cart/index');?>">去结算</a>
								</div>
							</div>
						</div>
						<?php } ?>
						
					</div>
				</div>
			</div>
			<div class="code">
				<a href=""><img width="75" src="http://127.0.0.1/huaweishop/Static/Index/images/code.jpg"/></a>
				<span id="">
					微信扫码关注我们
				</span>
			</div>
		</div>
		
		<div class="clean"></div>
		<!--logo结束-->
		<!--nav开始-->
		<div id="nav">
			<div class="all">
				<a href="">全部商品</a>
				<div class="leftsidebar">
					<?php foreach ($cate as $k=>$v){?>
					<div class="category">
						<h3><a style="font-size: 16px;" href="<?php echo U('List/index',array('cid'=>$v['cid'],'pid'=>$v['pid']));?>"><?php echo $v['cname'];?></a></h3>
						<?php foreach ($v['son'] as $kk=>$vv){?>
						<a href="<?php echo U('List/index',array('cid'=>$vv['cid'],'pid'=>$vv['pid']));?>"><?php echo $vv['cname'];?></a>
						<?php }?>
						<div class="subtitle">
							<?php foreach ($v['sons'] as $kk=>$vv){?>
							<h4><a href="<?php echo U('List/index',array('cid'=>$vv['cid'],'pid'=>$vv['pid']));?>"><?php echo $vv['cname'];?></a></h4>
							<?php }?>
						</div>
					</div>
					<?php }?>
					
				</div>
			</div>
			<ul>
				<li class="bg"><a href="<?php echo U('Index/index');?>">首页</a></li>
				<?php foreach ($nav as $k=>$v){?>
				<li><a href="<?php echo U('List/index',array('cid'=>$v['cid'],'pid'=>$v['pid']));?>"><?php echo $v['cname'];?></a></li>
				<?php }?>
			</ul>
		</div>
		<!--nav结束-->

<!--内容开始-->	
         <div id="content_subnav">
			<h1><a href="">首页</a>
				<?php foreach ($fatherCate as $k=>$v){?>
				&gt;<a href="<?php echo U('List/index',array('cid'=>$v['cid'],'pid'=>$v['pid']));?>"><?php echo $v['cname'];?></a>
				<?php }?>
				&gt;<a href=""><?php echo $goods['gname'];?></a></h1>
		</div>
		
		<!--商品展示-->
        <div id="content_msg">
			<div class="left">
				<?php foreach ($detail['mphoto'] as $k=>$v){?>
				<img class="g" src="http://127.0.0.1/huaweishop/<?php echo $v;?>"/>
				<?php }?>
				<br />
				<div class="lbtn">
					&lt;
				</div>
				<div class="mini ">
					<ul>
						<?php foreach ($detail['sphoto'] as $k=>$v){?>
						<li><img width="70" height="70" src="http://127.0.0.1/huaweishop/<?php echo $v;?>"/></li>
						<?php }?>
					</ul>
				</div>
				<div class="rbtn">
					&gt;
				</div>
			</div>
			<script type="text/javascript">
				$(function(){
					$("#content_msg .left .g").first().css({display:"block"});
					$("#content_msg .left .mini li").first().css({border:"1px solid red"});
				})
			</script>
			<script type="text/javascript">
				$(function(){					
					$("#content_msg .left .mini li").click(function(){
						var k=$(this).index();
						$("#content_msg .left .mini li").eq(k).css({border:"1px solid red"}).siblings("li").css({border:"1px solid #EDEDED"});
						$("#content_msg .left .g").eq(k).css({display:"block"}).siblings(".g").css({display:"none"});
					})
				})
			</script>
			<div class="right">
				<div class="follow">
					<h1><?php echo $goods['gname'];?></h1>
				</div>
				<div class="middle">
					<table id="price" border="0" cellspacing="" cellpadding="">
								<tr>
									<td>华 为  价：</td> 
								    <td>￥<span class="price" style="font-size: 20px; color:#E01D20 ;"><?php echo $goods['price'];?></span></td> 
								</tr>
								<tr>
									<td>商品编码：</td> 
								    <td><?php echo $goods['gnumber'];?></td> 
								</tr>
								<tr>
									<td>商品评分：</td> 
								    <td><s class="s"></s>（共 183 条评论）</td> 
								</tr>
								<tr>
									<td>运      费：</td> 
								    <td>满 100 免运费</td> 
								</tr>
								<tr>
									<td>服      务：</td> 
								    <td>由华为商城负责发货，并提供售后服务</td> 
								</tr>			
					</table>
				</div>
				<div class="under">
					
						<table border="0" cellspacing="" cellpadding="">
							<?php foreach ($attr as $k=>$v){?>
							<tr      <?php if($v['tem'][0]['gtvalue']){ ?>class="len" <?php }else{ ?> style="display:none"<?php } ?> >
								<td ><?php echo $v['taname'];?></td> 
								<td height="50px"> 
									<?php foreach ($v['tem'] as $kk=>$vv){?>
									<div class="standard" gtid="<?php echo $vv['gtid'];?>" gid="<?php echo $hd['get']['gid'];?>"  ><a  href="javascript:;"><?php echo $vv['gtvalue'];?></a></div>
									<?php }?>
								</td> 
								
							</tr>
							<?php }?>
							
							<tr >
								<td style="height: 30px; line-height: 30px;">购买数量：</td> 
								<td>
									<div class="reduct">
										-
									</div>
									<div class="num">
										<input style="width:46px; border: 0; text-align: center;" type="text" name="" id="" value="1" />
									</div>
									<div class="add">
										+
									</div>
									<span class="inventory" style="margin-top: 10px;">（库存0件）</span>
								</td> 
							</tr>
							
						</table>
						<p>您选择了 <span></span></p>
						<div class="shop_btn" />加入购物车</div>
					
					
				</div>
			</div>
		</div>
		<!--商品展示结束-->
		<div style="clear: both;"></div>
		<!--商品内容-->
		<div id="details">
			<div class="left">
				<div class="title">
				最近浏览过的商品
				</div>
				<div class="de_con">
					<table border="0" cellspacing="" cellpadding="" style="margin-top: 10px;">
						<tr>
							<td><img src="http://127.0.0.1/huaweishop/Static/Index/images/60_60_1.jpg"/></td>
							<td>
								<p><a href="">华为 P8max 智能手机</a></p>
								<br />
								
								<p><span>¥3788</span></p>
							</td>
						</tr>
						
					</table>
				</div>
			
			    <div class="de_con">
					<table border="0" cellspacing="" cellpadding="" style="margin-top: 10px;">
						<tr>
							<td><img src="http://127.0.0.1/huaweishop/Static/Index/images/60_60_1.jpg"/></td>
							<td>
								<p><a href="">华为 P8max 智能手机</a></p>
								<br />
								
								<p><span>¥3788</span></p>
							</td>
						</tr>
						
					</table>
				</div>
				<div class="de_con">
					<table border="0" cellspacing="" cellpadding="" style="margin-top: 10px;">
						<tr>
							<td><img src="http://127.0.0.1/huaweishop/Static/Index/images/60_60_1.jpg"/></td>
							<td>
								<p><a href="">华为 P8max 智能手机</a></p>
								<br />
								
								<p><span>¥3788</span></p>
							</td>
						</tr>
						
					</table>
				</div>
			
			</div>
			
			<div class="right">
				<!--题目-->
				<div class="subject">
					<div class="tab change">
						商品详情
					</div>
					<div class="tab">
						用户评价（1）
					</div>
					<div class="tab">
						规格参数
					</div>
					<div class="tab">
						包装清单
					</div>
					
					<div class="tab">
						售后服务
					</div>
				</div>
				<!--题目结束-->
				<div class="contents1 t  ">
					<?php echo $detail['intro'];?>
				</div>
				<div class="contents2  t ds">
					<div class="contents2_1">
						<div class="_left">
							<div class="lf">
							<h1>96<span>%</span></h1>
							<p>好评度</p>
							</div>
							<div class="rg">
								<dl>
									<dt>好评（96%）</dt>
									<dd><s class="ss" style="width:96%;"></s></dd>
								</dl>
								<dl>
									<dt>中评（96%）</dt>
									<dd><s class="ss" style="width:96%;"></s></dd>
								</dl>
								<dl>
									<dt>差评（96%）</dt>
									<dd><s class="ss" style="width:96%;"></s></dd>
								</dl>
							
							</div>
						</div>
						<div class="_middle">
						<p>买家印象：</p>
						</div>
						<div class="_right">
							<div class="publish"><a href="">发表评论</a></div>
						</div>
					</div>
				    <div class="contents2_2">
				    	<span class="entire spc point">全部评论（1）</span>
				    	<span class="good">好评（1）</span>
				    	<span class="evalua">中评（1）</span>
				    	<span class="bad">差评（1）</span>
				    </div>
				    <div class="contents2_3">
				    	<div class="clean"></div>
				    	<div class="content2_3_1 ">
					    	<div class="photo">
					    		<div class="head">
					    			<div class="lv5">
					    				
					    			</div>
					    		</div>
					    		<p style="text-align: center;word-wrap: break-word;">huafans0139247256</p>
					    	</div>
					    	<div class="ev">
					    		<div class="basic">
					    			<div class="basic_left">
					    				<span class="degree"><div class="dgv" style="width:80%"></div></span>
					    				<span>4分</span>
					    				<span>好评</span>
					    				<span>收到</span>
					    			</div>
					    			<div class="basic_right">
					    				2015-09-07 18:18:46
					    			</div>
					    		</div>
					    		<div style="min-height: 10px; overflow: hidden; float: left; margin-top: 10px;">
					    			<p>收到货好激动 顺丰发货就是快 刚用感觉不错 就是屏幕分辨率还是偏低 平时还好 一看电影 看图片就模糊 感觉不舒服 不过总体还不错</p>
					    		</div>
					    	</div>
				    	</div>
				    	<div class="clean"></div>
				    	<div class="content2_3_1 ">
					    	<div class="photo">
					    		<div class="head">
					    			<div class="lv5">
					    				
					    			</div>
					    		</div>
					    		<p style="text-align: center;word-wrap: break-word;">huafans0139247256</p>
					    	</div>
					    	<div class="ev">
					    		<div class="basic">
					    			<div class="basic_left">
					    				<span class="degree"><div class="dgv" style="width:80%"></div></span>
					    				<span>4分</span>
					    				<span>好评</span>
					    				<span>收到</span>
					    			</div>
					    			<div class="basic_right">
					    				2015-09-07 18:18:46
					    			</div>
					    		</div>
					    		<div style="min-height: 10px; overflow: hidden; float: left; margin-top: 10px;">
					    			<p>收到货好激动 顺丰发货就是快 刚用感觉不错 就是屏幕分辨率还是偏低 平时还好 一看电影 看图片就模糊 感觉不舒服 不过总体还不错</p>
					    		</div>
					    	</div>
				    	</div>
	                    <div class="clean"></div>
	                    <div style="height: 10px;"></div>
				    </div>
				
				</div>
				<div class="contents3 t ds">
					<div class="paramet">
						<div class="paramet_title">
						 主体
						</div>
						<table border="0" cellspacing="" cellpadding="" ">
							<tr>
								<td style="min-width: 200px;">品牌</td>
								<td>华为（HUAWEI）</td>
							</tr>
							<tr>
								<td>型号</td>
								<td>M2-801W</td>
							</tr>
						</table>
					</div>
					<div class="paramet">
						<div class="paramet_title">
						 主体
						</div>
						<table border="0" cellspacing="" cellpadding="" ">
							<tr>
								<td style="min-width: 200px;">品牌</td>
								<td>华为（HUAWEI）</td>
							</tr>
							<tr>
								<td>型号</td>
								<td>M2-801W</td>
							</tr>
						</table>
					</div>
					
				</div>	
				<div class="contents4 t ds">
				   <p>主机 x 1，充电器 x 1 ，数据线 x 1 ，说明书 x 1，保修卡 x 1</p>	
				</div>
				<div class="contents5 t ds">
					<p><?php echo $detail['service'];?></p>
				</div>
			</div>
		</div>
		<!--商品内容结束-->
        
<!--内容结束-->		
<!--底部开始-->
  <!--服务-->
  <div class="clean"></div>
  <div id="service">
  	<ul>
  		<li><span></span> 500强企业 品质保证</li>
  		<li><span class="conf1"></span> 7天退货 15天换货</li>
  		<li><span class="conf2"></span> 100元起免运费</li>
  		<li style="margin-right: 0;"><span class="conf3"></span> 448家维修网点 全国联保</li>
  	</ul>
  </div>
  <!--服务结束-->
  <!--帮助中心-->
  <div id="help">
  	<ul class="help">
  		<h1><span></span> 帮助中心</h1>
  		<li><a href="">购物指南</a></li>
  		<li><a href="">配送方式</a></li>
  		<li><a href="">支付方式</a></li>
  		<li><a href="">常见问题</a></li>
  	</ul>
  	<ul class="sever">
  		<h1><span></span> 售后服务</h1>
  		<li><a href="">购物指南</a></li>
  		<li><a href="">配送方式</a></li>
  		<li><a href="">支付方式</a></li>
  		<li><a href="">常见问题</a></li>
  	</ul>
  	<ul class="tech">
  		<h1><span></span> 技术支持</h1>
  		<li><a href="">购物指南</a></li>
  		<li><a href="">配送方式</a></li>
  		<li><a href="">支付方式</a></li>
  		<li><a href="">常见问题</a></li>
  	</ul>
  	<ul class="about">
  		<h1><span></span> 关于商城</h1>
  		<li><a href="">购物指南</a></li>
  		<li><a href="">配送方式</a></li>
  		<li><a href="">支付方式</a></li>
  		<li><a href="">常见问题</a></li>
  	</ul>
  	<ul class="Focus">
  		<h1><span></span> 关注我们</h1>
  		<li><a href="">购物指南</a></li>
  		<li><a href="">配送方式</a></li>
  		<li><a href="">支付方式</a></li>
  		<li><a href="">常见问题</a></li>
  	</ul>
  	
  </div>
  <!--帮助中心-->
  <!--友情链接-->
  <div id="link">
  	友情链接：<a href="">华为官网</a>|<a href="">华为消费者业务 </a>|<a href="">荣耀官网  </a>|<a href=""> 天天浏览器 </a>|<a href="">  莫塞尔商城</a>|<a href="">  爱旅官网 </a>|<a href="">  华为应用市场 </a>|<a href=""> 万表网  </a>|<a href="">手机之家</a>|<a href="">  中商情报网 </a>|<a href="">  钻石小鸟 </a>|<a href=""> 刷机精灵 </a>|<a href=""> 安卓市场 </a>|<a href=""> 优购物官网 </a>|<a href="">  移动叔叔 </a>|<a href=""> 奥特莱斯 </a>|<a href=""> 中关村商城 </a>|<a href=""> 酷狗音乐 </a>| 
  	
  		<a href=""><span style="color:#FF0000 ;"> 申请链接 >></span></a>
</div>
<!--友情链接-->
<h6>Copyright © 2011-2015 华为软件技术有限公司 版权所有 保留一切权利 苏B2-20130048号 | 苏ICP备09062682号-9 </h6>
<h2><a href="">网络文化经营许可证苏网文[2012]0401-019号</a></h2>
<h5><a href=""><img src="http://127.0.0.1/huaweishop/Static/Index/images/certificate_01.png"/></a><a href=""><img src="http://127.0.0.1/huaweishop/Static/Index/images/certificate_02.png"/></a><a href=""><img src="http://127.0.0.1/huaweishop/Static/Index/images/certificate_03.png"/></a></h5>
<!--底部结束-->
	</body>
</html>
